3.2.36 \(\int (a+b \text {sech}^2(c+d x))^4 \, dx\) [136]

3.2.36.1 Optimal result
3.2.36.2 Mathematica [A] (verified)
3.2.36.3 Rubi [A] (verified)
3.2.36.4 Maple [A] (verified)
3.2.36.5 Fricas [B] (verification not implemented)
3.2.36.6 Sympy [F]
3.2.36.7 Maxima [B] (verification not implemented)
3.2.36.8 Giac [B] (verification not implemented)
3.2.36.9 Mupad [B] (verification not implemented)

3.2.36.1 Optimal result

Integrand size = 14, antiderivative size = 111 \[ \int \left (a+b \text {sech}^2(c+d x)\right )^4 \, dx=a^4 x+\frac {b (2 a+b) \left (2 a^2+2 a b+b^2\right ) \tanh (c+d x)}{d}-\frac {b^2 \left (6 a^2+8 a b+3 b^2\right ) \tanh ^3(c+d x)}{3 d}+\frac {b^3 (4 a+3 b) \tanh ^5(c+d x)}{5 d}-\frac {b^4 \tanh ^7(c+d x)}{7 d} \]

output
a^4*x+b*(2*a+b)*(2*a^2+2*a*b+b^2)*tanh(d*x+c)/d-1/3*b^2*(6*a^2+8*a*b+3*b^2 
)*tanh(d*x+c)^3/d+1/5*b^3*(4*a+3*b)*tanh(d*x+c)^5/d-1/7*b^4*tanh(d*x+c)^7/ 
d
 
3.2.36.2 Mathematica [A] (verified)

Time = 5.08 (sec) , antiderivative size = 175, normalized size of antiderivative = 1.58 \[ \int \left (a+b \text {sech}^2(c+d x)\right )^4 \, dx=a^4 x+\frac {4 a^3 b \tanh (c+d x)}{d}+\frac {6 a^2 b^2 \tanh (c+d x)}{d}+\frac {4 a b^3 \tanh (c+d x)}{d}+\frac {b^4 \tanh (c+d x)}{d}-\frac {2 a^2 b^2 \tanh ^3(c+d x)}{d}-\frac {8 a b^3 \tanh ^3(c+d x)}{3 d}-\frac {b^4 \tanh ^3(c+d x)}{d}+\frac {4 a b^3 \tanh ^5(c+d x)}{5 d}+\frac {3 b^4 \tanh ^5(c+d x)}{5 d}-\frac {b^4 \tanh ^7(c+d x)}{7 d} \]

input
Integrate[(a + b*Sech[c + d*x]^2)^4,x]
 
output
a^4*x + (4*a^3*b*Tanh[c + d*x])/d + (6*a^2*b^2*Tanh[c + d*x])/d + (4*a*b^3 
*Tanh[c + d*x])/d + (b^4*Tanh[c + d*x])/d - (2*a^2*b^2*Tanh[c + d*x]^3)/d 
- (8*a*b^3*Tanh[c + d*x]^3)/(3*d) - (b^4*Tanh[c + d*x]^3)/d + (4*a*b^3*Tan 
h[c + d*x]^5)/(5*d) + (3*b^4*Tanh[c + d*x]^5)/(5*d) - (b^4*Tanh[c + d*x]^7 
)/(7*d)
 
3.2.36.3 Rubi [A] (verified)

Time = 0.29 (sec) , antiderivative size = 109, normalized size of antiderivative = 0.98, number of steps used = 5, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.286, Rules used = {3042, 4616, 300, 2009}

Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.

\(\displaystyle \int \left (a+b \text {sech}^2(c+d x)\right )^4 \, dx\)

\(\Big \downarrow \) 3042

\(\displaystyle \int \left (a+b \sec (i c+i d x)^2\right )^4dx\)

\(\Big \downarrow \) 4616

\(\displaystyle \frac {\int \frac {\left (-b \tanh ^2(c+d x)+a+b\right )^4}{1-\tanh ^2(c+d x)}d\tanh (c+d x)}{d}\)

\(\Big \downarrow \) 300

\(\displaystyle \frac {\int \left (-b^4 \tanh ^6(c+d x)+b^3 (4 a+3 b) \tanh ^4(c+d x)-b^2 \left (6 a^2+8 b a+3 b^2\right ) \tanh ^2(c+d x)+b (2 a+b) \left (2 a^2+2 b a+b^2\right )+\frac {a^4}{1-\tanh ^2(c+d x)}\right )d\tanh (c+d x)}{d}\)

\(\Big \downarrow \) 2009

\(\displaystyle \frac {a^4 \text {arctanh}(\tanh (c+d x))-\frac {1}{3} b^2 \left (6 a^2+8 a b+3 b^2\right ) \tanh ^3(c+d x)+b (2 a+b) \left (2 a^2+2 a b+b^2\right ) \tanh (c+d x)+\frac {1}{5} b^3 (4 a+3 b) \tanh ^5(c+d x)-\frac {1}{7} b^4 \tanh ^7(c+d x)}{d}\)

input
Int[(a + b*Sech[c + d*x]^2)^4,x]
 
output
(a^4*ArcTanh[Tanh[c + d*x]] + b*(2*a + b)*(2*a^2 + 2*a*b + b^2)*Tanh[c + d 
*x] - (b^2*(6*a^2 + 8*a*b + 3*b^2)*Tanh[c + d*x]^3)/3 + (b^3*(4*a + 3*b)*T 
anh[c + d*x]^5)/5 - (b^4*Tanh[c + d*x]^7)/7)/d
 

3.2.36.3.1 Defintions of rubi rules used

rule 300
Int[((a_) + (b_.)*(x_)^2)^(p_)*((c_) + (d_.)*(x_)^2)^(q_), x_Symbol] :> Int 
[PolynomialDivide[(a + b*x^2)^p, (c + d*x^2)^(-q), x], x] /; FreeQ[{a, b, c 
, d}, x] && NeQ[b*c - a*d, 0] && IGtQ[p, 0] && ILtQ[q, 0] && GeQ[p, -q]
 

rule 2009
Int[u_, x_Symbol] :> Simp[IntSum[u, x], x] /; SumQ[u]
 

rule 3042
Int[u_, x_Symbol] :> Int[DeactivateTrig[u, x], x] /; FunctionOfTrigOfLinear 
Q[u, x]
 

rule 4616
Int[((a_) + (b_.)*sec[(e_.) + (f_.)*(x_)]^2)^(p_), x_Symbol] :> With[{ff = 
FreeFactors[Tan[e + f*x], x]}, Simp[ff/f   Subst[Int[(a + b + b*ff^2*x^2)^p 
/(1 + ff^2*x^2), x], x, Tan[e + f*x]/ff], x]] /; FreeQ[{a, b, e, f, p}, x] 
&& NeQ[a + b, 0] && NeQ[p, -1]
 
3.2.36.4 Maple [A] (verified)

Time = 1.80 (sec) , antiderivative size = 129, normalized size of antiderivative = 1.16

method result size
derivativedivides \(\frac {a^{4} \left (d x +c \right )+4 a^{3} b \tanh \left (d x +c \right )+6 a^{2} b^{2} \left (\frac {2}{3}+\frac {\operatorname {sech}\left (d x +c \right )^{2}}{3}\right ) \tanh \left (d x +c \right )+4 a \,b^{3} \left (\frac {8}{15}+\frac {\operatorname {sech}\left (d x +c \right )^{4}}{5}+\frac {4 \operatorname {sech}\left (d x +c \right )^{2}}{15}\right ) \tanh \left (d x +c \right )+b^{4} \left (\frac {16}{35}+\frac {\operatorname {sech}\left (d x +c \right )^{6}}{7}+\frac {6 \operatorname {sech}\left (d x +c \right )^{4}}{35}+\frac {8 \operatorname {sech}\left (d x +c \right )^{2}}{35}\right ) \tanh \left (d x +c \right )}{d}\) \(129\)
default \(\frac {a^{4} \left (d x +c \right )+4 a^{3} b \tanh \left (d x +c \right )+6 a^{2} b^{2} \left (\frac {2}{3}+\frac {\operatorname {sech}\left (d x +c \right )^{2}}{3}\right ) \tanh \left (d x +c \right )+4 a \,b^{3} \left (\frac {8}{15}+\frac {\operatorname {sech}\left (d x +c \right )^{4}}{5}+\frac {4 \operatorname {sech}\left (d x +c \right )^{2}}{15}\right ) \tanh \left (d x +c \right )+b^{4} \left (\frac {16}{35}+\frac {\operatorname {sech}\left (d x +c \right )^{6}}{7}+\frac {6 \operatorname {sech}\left (d x +c \right )^{4}}{35}+\frac {8 \operatorname {sech}\left (d x +c \right )^{2}}{35}\right ) \tanh \left (d x +c \right )}{d}\) \(129\)
parts \(x \,a^{4}+\frac {b^{4} \left (\frac {16}{35}+\frac {\operatorname {sech}\left (d x +c \right )^{6}}{7}+\frac {6 \operatorname {sech}\left (d x +c \right )^{4}}{35}+\frac {8 \operatorname {sech}\left (d x +c \right )^{2}}{35}\right ) \tanh \left (d x +c \right )}{d}+\frac {4 a^{3} b \tanh \left (d x +c \right )}{d}+\frac {6 a^{2} b^{2} \left (\frac {2}{3}+\frac {\operatorname {sech}\left (d x +c \right )^{2}}{3}\right ) \tanh \left (d x +c \right )}{d}+\frac {4 a \,b^{3} \left (\frac {8}{15}+\frac {\operatorname {sech}\left (d x +c \right )^{4}}{5}+\frac {4 \operatorname {sech}\left (d x +c \right )^{2}}{15}\right ) \tanh \left (d x +c \right )}{d}\) \(133\)
risch \(x \,a^{4}-\frac {8 b \left (105 a^{3} {\mathrm e}^{12 d x +12 c}+630 a^{3} {\mathrm e}^{10 d x +10 c}+315 a^{2} b \,{\mathrm e}^{10 d x +10 c}+1575 a^{3} {\mathrm e}^{8 d x +8 c}+1365 a^{2} b \,{\mathrm e}^{8 d x +8 c}+560 a \,b^{2} {\mathrm e}^{8 d x +8 c}+2100 a^{3} {\mathrm e}^{6 d x +6 c}+2310 a^{2} b \,{\mathrm e}^{6 d x +6 c}+1400 a \,b^{2} {\mathrm e}^{6 d x +6 c}+420 \,{\mathrm e}^{6 d x +6 c} b^{3}+1575 a^{3} {\mathrm e}^{4 d x +4 c}+1890 a^{2} b \,{\mathrm e}^{4 d x +4 c}+1176 a \,b^{2} {\mathrm e}^{4 d x +4 c}+252 \,{\mathrm e}^{4 d x +4 c} b^{3}+630 a^{3} {\mathrm e}^{2 d x +2 c}+735 a^{2} b \,{\mathrm e}^{2 d x +2 c}+392 \,{\mathrm e}^{2 d x +2 c} a \,b^{2}+84 \,{\mathrm e}^{2 d x +2 c} b^{3}+105 a^{3}+105 a^{2} b +56 a \,b^{2}+12 b^{3}\right )}{105 d \left ({\mathrm e}^{2 d x +2 c}+1\right )^{7}}\) \(310\)
parallelrisch \(\frac {105 x \tanh \left (\frac {d x}{2}+\frac {c}{2}\right )^{14} a^{4} d +\left (840 a^{3} b +1260 a^{2} b^{2}+840 a \,b^{3}+210 b^{4}\right ) \tanh \left (\frac {d x}{2}+\frac {c}{2}\right )^{13}+735 x \tanh \left (\frac {d x}{2}+\frac {c}{2}\right )^{12} a^{4} d +\left (5040 a^{3} b +5880 a^{2} b^{2}+2800 a \,b^{3}+420 b^{4}\right ) \tanh \left (\frac {d x}{2}+\frac {c}{2}\right )^{11}+2205 x \tanh \left (\frac {d x}{2}+\frac {c}{2}\right )^{10} a^{4} d +\left (12600 a^{3} b +12180 a^{2} b^{2}+6328 a \,b^{3}+1806 b^{4}\right ) \tanh \left (\frac {d x}{2}+\frac {c}{2}\right )^{9}+3675 x \tanh \left (\frac {d x}{2}+\frac {c}{2}\right )^{8} a^{4} d +\left (16800 a^{3} b +15120 a^{2} b^{2}+8736 a \,b^{3}+1272 b^{4}\right ) \tanh \left (\frac {d x}{2}+\frac {c}{2}\right )^{7}+3675 x \tanh \left (\frac {d x}{2}+\frac {c}{2}\right )^{6} a^{4} d +\left (12600 a^{3} b +12180 a^{2} b^{2}+6328 a \,b^{3}+1806 b^{4}\right ) \tanh \left (\frac {d x}{2}+\frac {c}{2}\right )^{5}+2205 x \tanh \left (\frac {d x}{2}+\frac {c}{2}\right )^{4} a^{4} d +\left (5040 a^{3} b +5880 a^{2} b^{2}+2800 a \,b^{3}+420 b^{4}\right ) \tanh \left (\frac {d x}{2}+\frac {c}{2}\right )^{3}+735 x \tanh \left (\frac {d x}{2}+\frac {c}{2}\right )^{2} a^{4} d +\left (840 a^{3} b +1260 a^{2} b^{2}+840 a \,b^{3}+210 b^{4}\right ) \tanh \left (\frac {d x}{2}+\frac {c}{2}\right )+105 a^{4} d x}{105 d \left (\tanh \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}+1\right )^{7}}\) \(419\)

input
int((a+b*sech(d*x+c)^2)^4,x,method=_RETURNVERBOSE)
 
output
1/d*(a^4*(d*x+c)+4*a^3*b*tanh(d*x+c)+6*a^2*b^2*(2/3+1/3*sech(d*x+c)^2)*tan 
h(d*x+c)+4*a*b^3*(8/15+1/5*sech(d*x+c)^4+4/15*sech(d*x+c)^2)*tanh(d*x+c)+b 
^4*(16/35+1/7*sech(d*x+c)^6+6/35*sech(d*x+c)^4+8/35*sech(d*x+c)^2)*tanh(d* 
x+c))
 
3.2.36.5 Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 941 vs. \(2 (105) = 210\).

Time = 0.27 (sec) , antiderivative size = 941, normalized size of antiderivative = 8.48 \[ \int \left (a+b \text {sech}^2(c+d x)\right )^4 \, dx=\text {Too large to display} \]

input
integrate((a+b*sech(d*x+c)^2)^4,x, algorithm="fricas")
 
output
1/105*((105*a^4*d*x - 420*a^3*b - 420*a^2*b^2 - 224*a*b^3 - 48*b^4)*cosh(d 
*x + c)^7 + 7*(105*a^4*d*x - 420*a^3*b - 420*a^2*b^2 - 224*a*b^3 - 48*b^4) 
*cosh(d*x + c)*sinh(d*x + c)^6 + 4*(105*a^3*b + 105*a^2*b^2 + 56*a*b^3 + 1 
2*b^4)*sinh(d*x + c)^7 + 7*(105*a^4*d*x - 420*a^3*b - 420*a^2*b^2 - 224*a* 
b^3 - 48*b^4)*cosh(d*x + c)^5 + 28*(75*a^3*b + 105*a^2*b^2 + 56*a*b^3 + 12 
*b^4 + 3*(105*a^3*b + 105*a^2*b^2 + 56*a*b^3 + 12*b^4)*cosh(d*x + c)^2)*si 
nh(d*x + c)^5 + 35*((105*a^4*d*x - 420*a^3*b - 420*a^2*b^2 - 224*a*b^3 - 4 
8*b^4)*cosh(d*x + c)^3 + (105*a^4*d*x - 420*a^3*b - 420*a^2*b^2 - 224*a*b^ 
3 - 48*b^4)*cosh(d*x + c))*sinh(d*x + c)^4 + 21*(105*a^4*d*x - 420*a^3*b - 
 420*a^2*b^2 - 224*a*b^3 - 48*b^4)*cosh(d*x + c)^3 + 28*(5*(105*a^3*b + 10 
5*a^2*b^2 + 56*a*b^3 + 12*b^4)*cosh(d*x + c)^4 + 135*a^3*b + 225*a^2*b^2 + 
 168*a*b^3 + 36*b^4 + 10*(75*a^3*b + 105*a^2*b^2 + 56*a*b^3 + 12*b^4)*cosh 
(d*x + c)^2)*sinh(d*x + c)^3 + 7*(3*(105*a^4*d*x - 420*a^3*b - 420*a^2*b^2 
 - 224*a*b^3 - 48*b^4)*cosh(d*x + c)^5 + 10*(105*a^4*d*x - 420*a^3*b - 420 
*a^2*b^2 - 224*a*b^3 - 48*b^4)*cosh(d*x + c)^3 + 9*(105*a^4*d*x - 420*a^3* 
b - 420*a^2*b^2 - 224*a*b^3 - 48*b^4)*cosh(d*x + c))*sinh(d*x + c)^2 + 35* 
(105*a^4*d*x - 420*a^3*b - 420*a^2*b^2 - 224*a*b^3 - 48*b^4)*cosh(d*x + c) 
 + 28*((105*a^3*b + 105*a^2*b^2 + 56*a*b^3 + 12*b^4)*cosh(d*x + c)^6 + 5*( 
75*a^3*b + 105*a^2*b^2 + 56*a*b^3 + 12*b^4)*cosh(d*x + c)^4 + 75*a^3*b + 1 
35*a^2*b^2 + 120*a*b^3 + 60*b^4 + 9*(45*a^3*b + 75*a^2*b^2 + 56*a*b^3 +...
 
3.2.36.6 Sympy [F]

\[ \int \left (a+b \text {sech}^2(c+d x)\right )^4 \, dx=\int \left (a + b \operatorname {sech}^{2}{\left (c + d x \right )}\right )^{4}\, dx \]

input
integrate((a+b*sech(d*x+c)**2)**4,x)
 
output
Integral((a + b*sech(c + d*x)**2)**4, x)
 
3.2.36.7 Maxima [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 703 vs. \(2 (105) = 210\).

Time = 0.20 (sec) , antiderivative size = 703, normalized size of antiderivative = 6.33 \[ \int \left (a+b \text {sech}^2(c+d x)\right )^4 \, dx=a^{4} x + \frac {32}{35} \, b^{4} {\left (\frac {7 \, e^{\left (-2 \, d x - 2 \, c\right )}}{d {\left (7 \, e^{\left (-2 \, d x - 2 \, c\right )} + 21 \, e^{\left (-4 \, d x - 4 \, c\right )} + 35 \, e^{\left (-6 \, d x - 6 \, c\right )} + 35 \, e^{\left (-8 \, d x - 8 \, c\right )} + 21 \, e^{\left (-10 \, d x - 10 \, c\right )} + 7 \, e^{\left (-12 \, d x - 12 \, c\right )} + e^{\left (-14 \, d x - 14 \, c\right )} + 1\right )}} + \frac {21 \, e^{\left (-4 \, d x - 4 \, c\right )}}{d {\left (7 \, e^{\left (-2 \, d x - 2 \, c\right )} + 21 \, e^{\left (-4 \, d x - 4 \, c\right )} + 35 \, e^{\left (-6 \, d x - 6 \, c\right )} + 35 \, e^{\left (-8 \, d x - 8 \, c\right )} + 21 \, e^{\left (-10 \, d x - 10 \, c\right )} + 7 \, e^{\left (-12 \, d x - 12 \, c\right )} + e^{\left (-14 \, d x - 14 \, c\right )} + 1\right )}} + \frac {35 \, e^{\left (-6 \, d x - 6 \, c\right )}}{d {\left (7 \, e^{\left (-2 \, d x - 2 \, c\right )} + 21 \, e^{\left (-4 \, d x - 4 \, c\right )} + 35 \, e^{\left (-6 \, d x - 6 \, c\right )} + 35 \, e^{\left (-8 \, d x - 8 \, c\right )} + 21 \, e^{\left (-10 \, d x - 10 \, c\right )} + 7 \, e^{\left (-12 \, d x - 12 \, c\right )} + e^{\left (-14 \, d x - 14 \, c\right )} + 1\right )}} + \frac {1}{d {\left (7 \, e^{\left (-2 \, d x - 2 \, c\right )} + 21 \, e^{\left (-4 \, d x - 4 \, c\right )} + 35 \, e^{\left (-6 \, d x - 6 \, c\right )} + 35 \, e^{\left (-8 \, d x - 8 \, c\right )} + 21 \, e^{\left (-10 \, d x - 10 \, c\right )} + 7 \, e^{\left (-12 \, d x - 12 \, c\right )} + e^{\left (-14 \, d x - 14 \, c\right )} + 1\right )}}\right )} + \frac {64}{15} \, a b^{3} {\left (\frac {5 \, e^{\left (-2 \, d x - 2 \, c\right )}}{d {\left (5 \, e^{\left (-2 \, d x - 2 \, c\right )} + 10 \, e^{\left (-4 \, d x - 4 \, c\right )} + 10 \, e^{\left (-6 \, d x - 6 \, c\right )} + 5 \, e^{\left (-8 \, d x - 8 \, c\right )} + e^{\left (-10 \, d x - 10 \, c\right )} + 1\right )}} + \frac {10 \, e^{\left (-4 \, d x - 4 \, c\right )}}{d {\left (5 \, e^{\left (-2 \, d x - 2 \, c\right )} + 10 \, e^{\left (-4 \, d x - 4 \, c\right )} + 10 \, e^{\left (-6 \, d x - 6 \, c\right )} + 5 \, e^{\left (-8 \, d x - 8 \, c\right )} + e^{\left (-10 \, d x - 10 \, c\right )} + 1\right )}} + \frac {1}{d {\left (5 \, e^{\left (-2 \, d x - 2 \, c\right )} + 10 \, e^{\left (-4 \, d x - 4 \, c\right )} + 10 \, e^{\left (-6 \, d x - 6 \, c\right )} + 5 \, e^{\left (-8 \, d x - 8 \, c\right )} + e^{\left (-10 \, d x - 10 \, c\right )} + 1\right )}}\right )} + 8 \, a^{2} b^{2} {\left (\frac {3 \, e^{\left (-2 \, d x - 2 \, c\right )}}{d {\left (3 \, e^{\left (-2 \, d x - 2 \, c\right )} + 3 \, e^{\left (-4 \, d x - 4 \, c\right )} + e^{\left (-6 \, d x - 6 \, c\right )} + 1\right )}} + \frac {1}{d {\left (3 \, e^{\left (-2 \, d x - 2 \, c\right )} + 3 \, e^{\left (-4 \, d x - 4 \, c\right )} + e^{\left (-6 \, d x - 6 \, c\right )} + 1\right )}}\right )} + \frac {8 \, a^{3} b}{d {\left (e^{\left (-2 \, d x - 2 \, c\right )} + 1\right )}} \]

input
integrate((a+b*sech(d*x+c)^2)^4,x, algorithm="maxima")
 
output
a^4*x + 32/35*b^4*(7*e^(-2*d*x - 2*c)/(d*(7*e^(-2*d*x - 2*c) + 21*e^(-4*d* 
x - 4*c) + 35*e^(-6*d*x - 6*c) + 35*e^(-8*d*x - 8*c) + 21*e^(-10*d*x - 10* 
c) + 7*e^(-12*d*x - 12*c) + e^(-14*d*x - 14*c) + 1)) + 21*e^(-4*d*x - 4*c) 
/(d*(7*e^(-2*d*x - 2*c) + 21*e^(-4*d*x - 4*c) + 35*e^(-6*d*x - 6*c) + 35*e 
^(-8*d*x - 8*c) + 21*e^(-10*d*x - 10*c) + 7*e^(-12*d*x - 12*c) + e^(-14*d* 
x - 14*c) + 1)) + 35*e^(-6*d*x - 6*c)/(d*(7*e^(-2*d*x - 2*c) + 21*e^(-4*d* 
x - 4*c) + 35*e^(-6*d*x - 6*c) + 35*e^(-8*d*x - 8*c) + 21*e^(-10*d*x - 10* 
c) + 7*e^(-12*d*x - 12*c) + e^(-14*d*x - 14*c) + 1)) + 1/(d*(7*e^(-2*d*x - 
 2*c) + 21*e^(-4*d*x - 4*c) + 35*e^(-6*d*x - 6*c) + 35*e^(-8*d*x - 8*c) + 
21*e^(-10*d*x - 10*c) + 7*e^(-12*d*x - 12*c) + e^(-14*d*x - 14*c) + 1))) + 
 64/15*a*b^3*(5*e^(-2*d*x - 2*c)/(d*(5*e^(-2*d*x - 2*c) + 10*e^(-4*d*x - 4 
*c) + 10*e^(-6*d*x - 6*c) + 5*e^(-8*d*x - 8*c) + e^(-10*d*x - 10*c) + 1)) 
+ 10*e^(-4*d*x - 4*c)/(d*(5*e^(-2*d*x - 2*c) + 10*e^(-4*d*x - 4*c) + 10*e^ 
(-6*d*x - 6*c) + 5*e^(-8*d*x - 8*c) + e^(-10*d*x - 10*c) + 1)) + 1/(d*(5*e 
^(-2*d*x - 2*c) + 10*e^(-4*d*x - 4*c) + 10*e^(-6*d*x - 6*c) + 5*e^(-8*d*x 
- 8*c) + e^(-10*d*x - 10*c) + 1))) + 8*a^2*b^2*(3*e^(-2*d*x - 2*c)/(d*(3*e 
^(-2*d*x - 2*c) + 3*e^(-4*d*x - 4*c) + e^(-6*d*x - 6*c) + 1)) + 1/(d*(3*e^ 
(-2*d*x - 2*c) + 3*e^(-4*d*x - 4*c) + e^(-6*d*x - 6*c) + 1))) + 8*a^3*b/(d 
*(e^(-2*d*x - 2*c) + 1))
 
3.2.36.8 Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 334 vs. \(2 (105) = 210\).

Time = 0.30 (sec) , antiderivative size = 334, normalized size of antiderivative = 3.01 \[ \int \left (a+b \text {sech}^2(c+d x)\right )^4 \, dx=\frac {105 \, {\left (d x + c\right )} a^{4} - \frac {8 \, {\left (105 \, a^{3} b e^{\left (12 \, d x + 12 \, c\right )} + 630 \, a^{3} b e^{\left (10 \, d x + 10 \, c\right )} + 315 \, a^{2} b^{2} e^{\left (10 \, d x + 10 \, c\right )} + 1575 \, a^{3} b e^{\left (8 \, d x + 8 \, c\right )} + 1365 \, a^{2} b^{2} e^{\left (8 \, d x + 8 \, c\right )} + 560 \, a b^{3} e^{\left (8 \, d x + 8 \, c\right )} + 2100 \, a^{3} b e^{\left (6 \, d x + 6 \, c\right )} + 2310 \, a^{2} b^{2} e^{\left (6 \, d x + 6 \, c\right )} + 1400 \, a b^{3} e^{\left (6 \, d x + 6 \, c\right )} + 420 \, b^{4} e^{\left (6 \, d x + 6 \, c\right )} + 1575 \, a^{3} b e^{\left (4 \, d x + 4 \, c\right )} + 1890 \, a^{2} b^{2} e^{\left (4 \, d x + 4 \, c\right )} + 1176 \, a b^{3} e^{\left (4 \, d x + 4 \, c\right )} + 252 \, b^{4} e^{\left (4 \, d x + 4 \, c\right )} + 630 \, a^{3} b e^{\left (2 \, d x + 2 \, c\right )} + 735 \, a^{2} b^{2} e^{\left (2 \, d x + 2 \, c\right )} + 392 \, a b^{3} e^{\left (2 \, d x + 2 \, c\right )} + 84 \, b^{4} e^{\left (2 \, d x + 2 \, c\right )} + 105 \, a^{3} b + 105 \, a^{2} b^{2} + 56 \, a b^{3} + 12 \, b^{4}\right )}}{{\left (e^{\left (2 \, d x + 2 \, c\right )} + 1\right )}^{7}}}{105 \, d} \]

input
integrate((a+b*sech(d*x+c)^2)^4,x, algorithm="giac")
 
output
1/105*(105*(d*x + c)*a^4 - 8*(105*a^3*b*e^(12*d*x + 12*c) + 630*a^3*b*e^(1 
0*d*x + 10*c) + 315*a^2*b^2*e^(10*d*x + 10*c) + 1575*a^3*b*e^(8*d*x + 8*c) 
 + 1365*a^2*b^2*e^(8*d*x + 8*c) + 560*a*b^3*e^(8*d*x + 8*c) + 2100*a^3*b*e 
^(6*d*x + 6*c) + 2310*a^2*b^2*e^(6*d*x + 6*c) + 1400*a*b^3*e^(6*d*x + 6*c) 
 + 420*b^4*e^(6*d*x + 6*c) + 1575*a^3*b*e^(4*d*x + 4*c) + 1890*a^2*b^2*e^( 
4*d*x + 4*c) + 1176*a*b^3*e^(4*d*x + 4*c) + 252*b^4*e^(4*d*x + 4*c) + 630* 
a^3*b*e^(2*d*x + 2*c) + 735*a^2*b^2*e^(2*d*x + 2*c) + 392*a*b^3*e^(2*d*x + 
 2*c) + 84*b^4*e^(2*d*x + 2*c) + 105*a^3*b + 105*a^2*b^2 + 56*a*b^3 + 12*b 
^4)/(e^(2*d*x + 2*c) + 1)^7)/d
 
3.2.36.9 Mupad [B] (verification not implemented)

Time = 2.20 (sec) , antiderivative size = 1083, normalized size of antiderivative = 9.76 \[ \int \left (a+b \text {sech}^2(c+d x)\right )^4 \, dx=a^4\,x-\frac {\frac {8\,\left (a^3\,b+a^2\,b^2\right )}{7\,d}+\frac {8\,{\mathrm {e}}^{2\,c+2\,d\,x}\,\left (15\,a^3\,b+24\,a^2\,b^2+16\,a\,b^3\right )}{21\,d}+\frac {16\,{\mathrm {e}}^{6\,c+6\,d\,x}\,\left (15\,a^3\,b+24\,a^2\,b^2+16\,a\,b^3\right )}{21\,d}+\frac {16\,{\mathrm {e}}^{4\,c+4\,d\,x}\,\left (5\,a^3\,b+9\,a^2\,b^2+8\,a\,b^3+4\,b^4\right )}{7\,d}+\frac {40\,{\mathrm {e}}^{8\,c+8\,d\,x}\,\left (a^3\,b+a^2\,b^2\right )}{7\,d}+\frac {8\,a^3\,b\,{\mathrm {e}}^{10\,c+10\,d\,x}}{7\,d}}{6\,{\mathrm {e}}^{2\,c+2\,d\,x}+15\,{\mathrm {e}}^{4\,c+4\,d\,x}+20\,{\mathrm {e}}^{6\,c+6\,d\,x}+15\,{\mathrm {e}}^{8\,c+8\,d\,x}+6\,{\mathrm {e}}^{10\,c+10\,d\,x}+{\mathrm {e}}^{12\,c+12\,d\,x}+1}-\frac {\frac {8\,{\mathrm {e}}^{4\,c+4\,d\,x}\,\left (15\,a^3\,b+24\,a^2\,b^2+16\,a\,b^3\right )}{7\,d}+\frac {8\,{\mathrm {e}}^{8\,c+8\,d\,x}\,\left (15\,a^3\,b+24\,a^2\,b^2+16\,a\,b^3\right )}{7\,d}+\frac {8\,a^3\,b}{7\,d}+\frac {32\,{\mathrm {e}}^{6\,c+6\,d\,x}\,\left (5\,a^3\,b+9\,a^2\,b^2+8\,a\,b^3+4\,b^4\right )}{7\,d}+\frac {48\,{\mathrm {e}}^{2\,c+2\,d\,x}\,\left (a^3\,b+a^2\,b^2\right )}{7\,d}+\frac {48\,{\mathrm {e}}^{10\,c+10\,d\,x}\,\left (a^3\,b+a^2\,b^2\right )}{7\,d}+\frac {8\,a^3\,b\,{\mathrm {e}}^{12\,c+12\,d\,x}}{7\,d}}{7\,{\mathrm {e}}^{2\,c+2\,d\,x}+21\,{\mathrm {e}}^{4\,c+4\,d\,x}+35\,{\mathrm {e}}^{6\,c+6\,d\,x}+35\,{\mathrm {e}}^{8\,c+8\,d\,x}+21\,{\mathrm {e}}^{10\,c+10\,d\,x}+7\,{\mathrm {e}}^{12\,c+12\,d\,x}+{\mathrm {e}}^{14\,c+14\,d\,x}+1}-\frac {\frac {8\,\left (a^3\,b+a^2\,b^2\right )}{7\,d}+\frac {8\,a^3\,b\,{\mathrm {e}}^{2\,c+2\,d\,x}}{7\,d}}{2\,{\mathrm {e}}^{2\,c+2\,d\,x}+{\mathrm {e}}^{4\,c+4\,d\,x}+1}-\frac {\frac {8\,\left (15\,a^3\,b+24\,a^2\,b^2+16\,a\,b^3\right )}{105\,d}+\frac {16\,{\mathrm {e}}^{4\,c+4\,d\,x}\,\left (15\,a^3\,b+24\,a^2\,b^2+16\,a\,b^3\right )}{35\,d}+\frac {32\,{\mathrm {e}}^{2\,c+2\,d\,x}\,\left (5\,a^3\,b+9\,a^2\,b^2+8\,a\,b^3+4\,b^4\right )}{35\,d}+\frac {32\,{\mathrm {e}}^{6\,c+6\,d\,x}\,\left (a^3\,b+a^2\,b^2\right )}{7\,d}+\frac {8\,a^3\,b\,{\mathrm {e}}^{8\,c+8\,d\,x}}{7\,d}}{5\,{\mathrm {e}}^{2\,c+2\,d\,x}+10\,{\mathrm {e}}^{4\,c+4\,d\,x}+10\,{\mathrm {e}}^{6\,c+6\,d\,x}+5\,{\mathrm {e}}^{8\,c+8\,d\,x}+{\mathrm {e}}^{10\,c+10\,d\,x}+1}-\frac {\frac {8\,\left (5\,a^3\,b+9\,a^2\,b^2+8\,a\,b^3+4\,b^4\right )}{35\,d}+\frac {8\,{\mathrm {e}}^{2\,c+2\,d\,x}\,\left (15\,a^3\,b+24\,a^2\,b^2+16\,a\,b^3\right )}{35\,d}+\frac {24\,{\mathrm {e}}^{4\,c+4\,d\,x}\,\left (a^3\,b+a^2\,b^2\right )}{7\,d}+\frac {8\,a^3\,b\,{\mathrm {e}}^{6\,c+6\,d\,x}}{7\,d}}{4\,{\mathrm {e}}^{2\,c+2\,d\,x}+6\,{\mathrm {e}}^{4\,c+4\,d\,x}+4\,{\mathrm {e}}^{6\,c+6\,d\,x}+{\mathrm {e}}^{8\,c+8\,d\,x}+1}-\frac {\frac {8\,\left (15\,a^3\,b+24\,a^2\,b^2+16\,a\,b^3\right )}{105\,d}+\frac {16\,{\mathrm {e}}^{2\,c+2\,d\,x}\,\left (a^3\,b+a^2\,b^2\right )}{7\,d}+\frac {8\,a^3\,b\,{\mathrm {e}}^{4\,c+4\,d\,x}}{7\,d}}{3\,{\mathrm {e}}^{2\,c+2\,d\,x}+3\,{\mathrm {e}}^{4\,c+4\,d\,x}+{\mathrm {e}}^{6\,c+6\,d\,x}+1}-\frac {8\,a^3\,b}{7\,d\,\left ({\mathrm {e}}^{2\,c+2\,d\,x}+1\right )} \]

input
int((a + b/cosh(c + d*x)^2)^4,x)
 
output
a^4*x - ((8*(a^3*b + a^2*b^2))/(7*d) + (8*exp(2*c + 2*d*x)*(16*a*b^3 + 15* 
a^3*b + 24*a^2*b^2))/(21*d) + (16*exp(6*c + 6*d*x)*(16*a*b^3 + 15*a^3*b + 
24*a^2*b^2))/(21*d) + (16*exp(4*c + 4*d*x)*(8*a*b^3 + 5*a^3*b + 4*b^4 + 9* 
a^2*b^2))/(7*d) + (40*exp(8*c + 8*d*x)*(a^3*b + a^2*b^2))/(7*d) + (8*a^3*b 
*exp(10*c + 10*d*x))/(7*d))/(6*exp(2*c + 2*d*x) + 15*exp(4*c + 4*d*x) + 20 
*exp(6*c + 6*d*x) + 15*exp(8*c + 8*d*x) + 6*exp(10*c + 10*d*x) + exp(12*c 
+ 12*d*x) + 1) - ((8*exp(4*c + 4*d*x)*(16*a*b^3 + 15*a^3*b + 24*a^2*b^2))/ 
(7*d) + (8*exp(8*c + 8*d*x)*(16*a*b^3 + 15*a^3*b + 24*a^2*b^2))/(7*d) + (8 
*a^3*b)/(7*d) + (32*exp(6*c + 6*d*x)*(8*a*b^3 + 5*a^3*b + 4*b^4 + 9*a^2*b^ 
2))/(7*d) + (48*exp(2*c + 2*d*x)*(a^3*b + a^2*b^2))/(7*d) + (48*exp(10*c + 
 10*d*x)*(a^3*b + a^2*b^2))/(7*d) + (8*a^3*b*exp(12*c + 12*d*x))/(7*d))/(7 
*exp(2*c + 2*d*x) + 21*exp(4*c + 4*d*x) + 35*exp(6*c + 6*d*x) + 35*exp(8*c 
 + 8*d*x) + 21*exp(10*c + 10*d*x) + 7*exp(12*c + 12*d*x) + exp(14*c + 14*d 
*x) + 1) - ((8*(a^3*b + a^2*b^2))/(7*d) + (8*a^3*b*exp(2*c + 2*d*x))/(7*d) 
)/(2*exp(2*c + 2*d*x) + exp(4*c + 4*d*x) + 1) - ((8*(16*a*b^3 + 15*a^3*b + 
 24*a^2*b^2))/(105*d) + (16*exp(4*c + 4*d*x)*(16*a*b^3 + 15*a^3*b + 24*a^2 
*b^2))/(35*d) + (32*exp(2*c + 2*d*x)*(8*a*b^3 + 5*a^3*b + 4*b^4 + 9*a^2*b^ 
2))/(35*d) + (32*exp(6*c + 6*d*x)*(a^3*b + a^2*b^2))/(7*d) + (8*a^3*b*exp( 
8*c + 8*d*x))/(7*d))/(5*exp(2*c + 2*d*x) + 10*exp(4*c + 4*d*x) + 10*exp(6* 
c + 6*d*x) + 5*exp(8*c + 8*d*x) + exp(10*c + 10*d*x) + 1) - ((8*(8*a*b^...